#ifndef __SKIPLIST_NODE_H__
#define __SKIPLIST_NODE_H__
#include <iostream>

using std::cout;
using std::endl;

class SkipList;
class SLNode;

class SLNodeLevel
{
    friend class SkipList;

public:
    SLNode *forward;
    int span;
};

class SLNode
{
    friend class SkipList;

public:
    SLNode() {}

    SLNode(int, int);

    ~SLNode();

private:
    int key;
    SLNodeLevel *forwards;
    int nodeLevel;
};

SLNode::SLNode(int k, int level)
    : key(k), nodeLevel(level), forwards(new SLNodeLevel[level])
{
}

SLNode::~SLNode()
{
    delete[] forwards;
}

#endif
